import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';

import { HttpWikiService } from './http-wiki.service';

@Component({
    moduleId: module.id,
    selector: 'guide-http-wiki',
    templateUrl: 'http-wiki.component.html',
    providers: [HttpWikiService]
})
export class HttpWikiComponent implements OnInit {
    title = '维基百科Demo';
    fetches = '每次按键获取';
    items: Observable<string[]>;
    constructor(private wikiService: HttpWikiService) { }

    search(term: string) {
        this.items = this.wikiService.search(term);
    }

    ngOnInit() { }
}